package main
import (
	"net/http"
	"text/template"
	"log"
)

func main(){
	http.HandleFunc("/", Index)
	log.Println("Serve Listen ...")
	http.ListenAndServe(":8000", nil)
}

func Index(writer http.ResponseWriter, request *http.Request){
	
	/*第一步，解析文件*/
	t, err := template.ParseFiles("./tab.html")
	
	/*第二步，初始化*/
	templates := template.Must(t, err)
	
	/*第三步，将解析后的模板，应用到参数二，然后输入到writer里面*/
	templates.Execute(writer, nil)
}
